package demo2;

import java.io.*;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 38917
 * Date: 2025-03-12
 * Time: 00:18
 */
public class Reader_Writer {
    public static void main(String[] args) {
        try(Reader reader = new FileReader("./aaa/bbb/ccc/a.text");
            Writer writer = new FileWriter("./aaa/bbb/ccc/a.text",true) {
            }){
            //
            writer.write("逆天而行");
            //
            char[] array = new char[1024];
            int ret = reader.read(array);
            System.out.println(new String(array, 0, ret));
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
}
